% V20210224 - 9.2.1 GW_RADIO_SELECTED INCLUDE "GW.bas" % Create a page. p = GW_NEW_PAGE() % Prepare title bar string. Title$ = GW_ADD_BAR_TITLE$("Radio-control Example") % Add title to page. GW_ADD_TITLEBAR(p, Title$) % Add descriptive text. GW_ADD_TEXT(p, "This is an example of the RADIO control:") % Now add the controls. R1 = GW_ADD_RADIO(p, 0, "I can be selected") R2 = GW_ADD_RADIO(p, R1, ">Or I can be selected") R3 = GW_ADD_RADIO(p, R1, "Or me ...but only one at a time!") % Add a button control. GW_ADD_BUTTON(p, "Which is selected?", "Radio") % Add a text box for the results. TB = GW_ADD_TEXTBOX(p, "") % Now show the page. GW_RENDER(p) DO % Wait for user action. r$ = GW_WAIT_ACTION$() % Place here any necessary code to process user actions. % Example feedback. POPUP r$ IF r$ = "Radio" IF GW_RADIO_SELECTED(R1) e$ = "First" ELSEIF GW_RADIO_SELECTED(R2) e$ = "Second" ELSEIF GW_RADIO_SELECTED(R3) e$ = "Third" ELSE e$ = "No" ENDIF e$ += " radio control is selected" GW_MODIFY(TB, "text", e$) ENDIF % End when BACK key is pressed. UNTIL r$ = "BACK" END "End of Radio-control example."